<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Exception;

use App\Constants\ErrorCode;
use Hyperf\Server\Exception\ServerException;

class BussinessException extends ServerException
{
    public function __construct(int $code = 0, string $msg = null, \Throwable $throwable = null)
    {
        if (is_null($msg) || empty($msg)) {
            $msg = ErrorCode::getMessage($code);
        }
        parent::__construct($msg, $code, $throwable);
    }
}
